<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
    <class name="${properties.pojoPkgName}.${className}" table="${tableName}" schema="${schema}">
        <id name="${pk.pkClassName?uncap_first}" type="java.lang.Long">
            <column name="${pk.pkColumnName}"/>
            <generator class="sequence">
                <param name="sequence">SEQ_${pk.pkColumnName}</param>
            </generator>
        </id>
        <#list fields as pro>
        <property name="${pro.className?uncap_first}" type="java.lang.${pro.classType}">
            <column name="${pro.name}" length="${pro.length}" />
        </property>
        </#list>
        <#list importKey as impKey>
        <many-to-one name="${impKey.keyTableClassName?uncap_first}" class="${properties.pojoPkgName}.${impKey.keyTableClassName}" fetch="select">
            <column name="${impKey.keyColumnName}" />
        </many-to-one>
        </#list>
        <#list exportKey as expKey>
        <set name="${expKey.keyTableClassName?uncap_first}s" table="${expKey.keyTableName}" inverse="true" lazy="true" >
            <key>
                <column name="${expKey.keyColumnName}" />
            </key>
            <one-to-many class="${properties.pojoPkgName}.${expKey.keyTableClassName}" />
        </set>
        </#list>
    </class>
</hibernate-mapping>